Test switch and special parameters in Shell script, shell script1. Test Switch
The following table lists the meanings of the test commands and whether they can be used in test commands, bash, and ksh.
Switch
Test
Bash
Ksh
Functions in a shell script
The function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit directly.
Format:function F_name () {Command
The command line has a fairly high reputation for Linux users. Unlike other operating systems, the command line is a scary proposition, but for the experienced Daniel in the Linux community, the command line is the most recommended and encouraged to
Create scriptFunctional testing is a key part of software development-and bash loaded into Linux can help you easily complete functional testing. In this article, Angel Rivera describes how to use bash shell scripts to execute Linux applications by
1. Determine the logged-on user1.1 Scripts[Email protected]_1 shell]$ VI check_user.sh#! /bin/shecho "You is logged in as ' WhoAmI '"; if [' whoami '! = Devtac]; Then echo "must is logged in as Devtac-to-run this script." Exitfiecho "Running
I. Functions in the shellThe function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit directly.1. function formatfunction f_name() { command}The
The so-called location parameter refers to the shell script command line parameter. In Shell functions, their colleagues can also be function parameters. Each parameter is named by an integer. For historical reasons, when it exceeds 9, it should be
File command to view the properties of *.sh ASCII text with the CRLF line terminators
The line end flags for Linux and Windows text files are different. In Linux, the text file uses "/n" for carriage return, while Windows uses "/r/n" to indicate
Early knowledge of sed and gawk in Linux Command Line and shell script ProgrammingThe sed editor of the Text Processing editor can process data in a data stream based on commands that are input to the command line or stored in the Command text file.
I. Functions in the shell[Email protected] aming]# cd/root/shell/aming[Email protected] aming]# vim fun1.sh//need to be aware that function names cannot conflict with some keywords in the shell#!/bin/bashfunction InP () {Echo $ $ $ $#}INP 1 a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.